<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'ReportForms.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<link rel="stylesheet" type="text/css" href="css/main.css" />
		<link rel="StyleSheet" type="text/css" href="css/dtree.css" />
		<!-- DTree -->
		<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="js/app.js"></script>
		<script type="text/javascript" src="js/dtree.js"></script>
		<!-- DWR -->
		<script type="text/javascript" src="dwr/engine.js"></script>
		<script type="text/javascript" src="dwr/util.js"></script>
		<script type="text/javascript" src="dwr/interface/categoryManager.js"></script>
		<script type="text/javascript" src="dwr/interface/categoryQuery.js"></script>
		<script type="text/javascript" src="dwr/interface/assetCardQuery.js"></script>
		<script type="text/javascript" src="dwr/interface/assetCardByAccount.js"></script>
		<script type="text/javascript" src="dwr/interface/findAssetCardBookByAcprimarystatus.js"></script>
		<script type="text/javascript" src="dwr/interface/findAssetCardBookByStatus.js"></script>
		<script type="text/javascript" src="dwr/interface/findAssetCardBookByOver.js"></script>
		<script type="text/javascript" src="dwr/interface/ToOutExcel.js"></script>
		<script type="text/javascript"
			src="dwr/interface/findAssetCardByDepName.js"></script>
		<script type="text/javascript" src="dwr/interface/departmentDwrJs.js"></script>
		<!-- amcharts -->
		<script type="text/javascript" src="page/search/ampie/swfobject.js"></script>
		<script type="text/javascript" src="page/search/amcolumn/swfobject.js"></script>
		<script type="text/javascript">
		var priceToOut = new Array();
		var nameToOut = new Array();
		var formatDate=function(date,format){  
    function today(day){  
        switch(day){  
            case 0:  
                day = "星期日";  
                break;  
            case 1:  
                day = "星期一";  
                break;  
            case 2:  
                day = "星期二";  
                break;  
            case 3:  
                day = "星期三";  
                break;  
            case 4:  
                day = "星期四";  
                break;  
            case 5:  
                day = "星期五";  
                break;  
           case 6:  
                day = "星期六";  
               break;  
            default:  
                day = "error";  
        }  
        return day;  
    }  
  
   var yLen=0;  
    for(var i=0;i<format.length;i++){  
        if(format.charAt(i)=="y")yLen++;  
   }  
  
    var M=true;//月   
    var d=true;//日   
    var t=false;//时   
   var m=false;//分   
   var s=false;//秒   
    var D=false;//星期   
  
    if(format.match("MM")){  
        M=true;  
    }else{  
        M=false;  
    }  
   if(format.match("dd")){  
       d=true;  
    }else{  
       d=false;  
    }  
   if(format.match("tt")){  
        t=true;  
   }else{  
        t=false;  
    }  
    if(format.match("mm")){  
        m=true;  
   }else{  
       m=false;  
   }  
    if(format.match("ss")){  
        s=true;  
    }else{  
        s=false;  
    }  
   if(format.match("星期")){  
        D=true;  
    }else{  
       D=false;  
   }  
 
   var ymd="";  
    var tms="";  
    var day="";  
    var sp0="";  
    var sp1="";  
 
    var str="";  
    if(yLen==4){  
        ymd=ymd+date.getFullYear()+"年";  
    }  
    if(yLen==2){  
        var year=new String(date.getFullYear());  
        var ss=year.substr(2, 2);  
        ymd=ymd+ss+"年";  
    }  
    if(M){  
        ymd=ymd+(date.getMonth()+1)+"月";  
    }  
    if(d){  
        ymd=ymd+date.getDate()+"日";  
    }  
    if(t){  
        tms=tms+date.getHours()+"时";  
   }  
    if(m){  
        tms=tms+date.getMinutes()+"分";  
    }  
    if(s){
        tms=tms+date.getSeconds()+"秒";  
    }  
    if(D){  
        day=today(date.getDay());  
    }  
  
    if(ymd!="")sp0=" ";  
    if(tms!="")sp1=" ";  
    str=ymd+sp0+tms+sp1+day;  
    return str;  
} 
		function toGetExcel(){  
			try{   
				var Message = "请选择文件夹"; //选择框提示信息   
				var Shell = new ActiveXObject( "Shell.Application" );   
				var Folder = Shell.BrowseForFolder(0,Message,0x0040,0x11);//第四个参数，为0x11或17表示起始目录为：我的电脑   
				//var Folder = Shell.BrowseForFolder(0,Message,0); //起始目录为：桌面   
				if(Folder != null){   
			    	Folder = Folder.items(); // 返回 FolderItems 对象   
			    	Folder = Folder.item(); // 返回 Folderitem 对象   
			    	Folder = Folder.Path;   // 返回路径   
					if(Folder.charAt(Folder.length-1) != "\\"){   
			 			Folder = Folder + "\\";   
					}
					
					var toExcelUrl = Folder;
					toExcelUrl += $('input#xlsName').val();
					$('input#xlsName').val(toExcelUrl);
				}
			}catch(e){    
				alert(e.message);   
			}
		}
		function getToExcel(){
			var thelist = new Array();
			for(var num = 0; num < nameToOut.length;num++){
				if(typeof(nameToOut[num])=="object"){
				thelist[num] = formatDate(nameToOut[num],"yyyy年MM月dd日 tt时mm分ss秒");
				}	
			}
			ToOutExcel.OutToExcel(thelist,priceToOut,$('input#xlsName').val(),function(flag){
				//alert(flag);
			});
		}	
		//	$('div#hid').val($('div#getURL').val());
		//	alert($('div#hid').val());
			//ToOutExcel.OutToExcel(nameToOut,priceToOut,,function(flag){
			//	alert(flag);
			//});
	//	}
		function openAmpie(amp){
			var se = new SWFObject("page/search/ampie/ampie.swf", "ampie", "800", "400", "8", "#FFFFFF");
			se.addVariable("path", "page/search/ampie/");
			se.addVariable("chart_settings", encodeURIComponent("<settings><legend><max_columns>1</max_columns><x>50%</x><y>20%</y><width>30%</width><text_size>13</text_size><border_alpha>14</border_alpha><spacing>8</spacing><margins>3</margins><align>center</align><key><size>12</size></key><values><enabled>1</enabled><text>{percents}%  ({value})</text></values></legend><pie><x>20%</x><y>50%</y><radius>135</radius><inner_radius>20</inner_radius><height>20</height><angle>40</angle><start_angle>360</start_angle><alpha>95</alpha><hover_brightness>30</hover_brightness></pie><animation><start_time>3</start_time><pull_out_time>1.5</pull_out_time></animation><data_labels><line_alpha>8</line_alpha></data_labels><strings><no_data>没有符合条件的数据</no_data></strings><labels><label lid='0'><text><![CDATA[<b>饼状图</b>]]></text><y>5</y><text_size>15</text_size><align>center</align></label></labels></settings>"));
			se.addVariable("chart_data", encodeURIComponent(amp));
			se.write("amcharts_1");
			$('input#check_1').css('display','block');    
			$('input#check_2').css('display','block');  
			$('input#check_3').css('display','none');
		}
		function openAmcolumn(amc){
			var so = new SWFObject("page/search/amcolumn/amcolumn.swf", "amcolumn","800", "400", "8", "#FFFFFF");
			so.addVariable("path", "page/search/amcolumn/");
			so.addVariable("chart_settings", encodeURIComponent("<settings><data_type>xml</data_type><font>Tahoma</font><background><border_alpha>15</border_alpha></background><plot_area><margins><left>70</left><right>50</right><top>38</top><bottom>50</bottom></margins></plot_area><grid><category><dashed>1</dashed></category><value><dashed>1</dashed></value></grid><axes><category><tick_length>5</tick_length><width>1</width></category><value><tick_length>5</tick_length><width>1</width></value></axes><values><value><min>0</min><skip_first>0</skip_first></value></values><balloon><alpha>85</alpha></balloon><legend><enabled>0</enabled></legend><angle>35</angle><depth>15</depth><column><width>85</width><spacing>15</spacing><hover_brightness>30</hover_brightness><grow_time>3</grow_time><sequenced_grow>1</sequenced_grow></column><strings><no_data>没有符合条件的数据</no_data></strings><graphs><graph gid='1'><title>柱状图</title><balloon_text>{series}: {value}</balloon_text></graph></graphs><labels><label lid='0'><text><![CDATA[<b>柱状图</b>]]></text><x>18</x><y>300</y><rotate>1</rotate><text_size>13</text_size><align>center</align></label><label lid='1'><text><![CDATA[<b>柱状图</b>]]></text><text_size>14</text_size><align>center</align></label></labels><guides><guide gid='1'/></guides></settings>"));
			so.addVariable("chart_data", encodeURIComponent(amc));
			so.write("amcharts_2");
			$('input#check_1').css('display','block');    
			$('input#check_2').css('display','block');  
			$('input#check_3').css('display','none');
		}
		function openAmline(aml){
			var so = new SWFObject("page/search/amline/amline.swf", "amline", "800", "400", "8", "#FFFFFF");
			so.addVariable("path", "page/search/amline/");
			so.addVariable("chart_settings", encodeURIComponent("<settings><font>Tahoma</font><hide_bullets_count>18</hide_bullets_count><background><alpha>90</alpha><border_alpha>10</border_alpha></background><plot_area><margins><left>50</left><right>40</right><bottom>65</bottom></margins></plot_area><grid><x><alpha>10</alpha><approx_count>9</approx_count></x><y_left><alpha>10</alpha></y_left></grid><axes><x><width>1</width><color>0D8ECF</color></x><y_left><width>1</width><color>0D8ECF</color></y_left></axes><indicator><color>0D8ECF</color><x_balloon_text_color>FFFFFF</x_balloon_text_color><line_alpha>50</line_alpha><selection_color>0D8ECF</selection_color><selection_alpha>20</selection_alpha></indicator><zoom_out_button><text_color_hover>FF0F00</text_color_hover></zoom_out_button><help><button><color>FCD202</color><text_color>000000</text_color><text_color_hover>FF0F00</text_color_hover></button><balloon><text><![CDATA[Click on the graph to turn on/off value baloon <br/><br/>Click on legend key to show/hide graph<br/><br/>Mark the area you wish to enlarge]]></text><color>FCD202</color><text_color>000000</text_color></balloon></help><graphs><graph gid='0'><title>Anomaly</title><color>0D8ECF</color><color_hover>FF0F00</color_hover><selected>0</selected></graph><graph gid='1'><title>Smoothed</title><color>B0DE09</color><color_hover>FF0F00</color_hover><line_width>2</line_width><fill_alpha>30</fill_alpha><bullet>round</bullet></graph></graphs><labels><label lid='0'><text><![CDATA[<b>Temperature anomaly</b>]]></text><y>25</y><text_size>13</text_size><align>center</align></label></labels></settings>"));
			so.addVariable("chart_data", encodeURIComponent(aml));
			so.write("amcharts_3");
			$('input#check_1').css('display','none');    
			$('input#check_2').css('display','block');  
			$('input#check_3').css('display','block');
		}
		function doQuery(key){
			//queryCategory(key);
			//queryAssetCard(key);
			//doFindByDep(key);
			//doFindByDep_1(key);
			//findAssetCardByAccountSubject(key);
			//findAssetCardByAccountSubject_1(key);
			//findTimeAssetCard(key);
			//findTimeAssetCard_1(key);
			//findTimeAssetCardStatus(key);
			//findTimeAssetCardStatus_1(key);
			//findOverAsserCardBook(key);
			//findOverAsserCardBook_1(key);
		}
		function findOverAsserCardBook_1(catId){
			findAssetCardBookByOver.getByAcprimarystatusToOver(function(AssetCardBook){
				var amc = "<chart>";
				var a = "<series>";
				var b = "<graphs><graph gid='0'>";
				var num = 0;
				for(var i = 0;i<AssetCardBook.length;i++){
					if(AssetCardBook[i].card!=null&&AssetCardBook[i].card.category!=null&&catId==AssetCardBook[i].card.category.catid){
						a += "<value xid='"+ num +"'>"+formatDate(AssetCardBook[i].operatedate,"yyyy年MM月dd日 tt时mm分ss秒")+"</value>";
						b += "<value xid='"+ num +"'>"+AssetCardBook[i].card.count+"</value>";
						nameToOut[num] = AssetCardBook[i].operatedate;
						priceToOut[num] = AssetCardBook[i].card.count;
						num++;
					}
				}
				amc += a + "</series>" + b + "</graph></graphs></chart>";
				openAmcolumn(amc);
				openAmline(amc);
			});
		}
		function findOverAsserCardBook(catId){
			$('input#hid').val(catId);
			findAssetCardBookByOver.getByAcprimarystatusToOver(function(AssetCardBook){
				var amc = "<chart>";
				var a = "<series>";
				var b = "<graphs><graph gid='0'>";
				var num = 0;
				catId = $('input#hid').val();
				for(var i = 0;i<AssetCardBook.length;i++){
					if(AssetCardBook[i].card!=null&&AssetCardBook[i].card.category!=null&&catId==AssetCardBook[i].card.category.catid){
						a += "<value xid='"+ num +"'>"+formatDate(AssetCardBook[i].operatedate,"yyyy年MM月dd日 tt时mm分ss秒")+"</value>";
						b += "<value xid='"+ num +"'>"+parseInt(AssetCardBook[i].card.count)*parseInt(AssetCardBook[i].card.reportprice)+"</value>";
						nameToOut[num] = AssetCardBook[i].operatedate;
						priceToOut[num] = parseInt(AssetCardBook[i].card.count)*parseInt(AssetCardBook[i].card.reportprice);
						num++;
					}
				}
				amc += a + "</series>" + b + "</graph></graphs></chart>";
				openAmcolumn(amc);
				openAmline(amc);
			});
		}
		function findTimeAssetCard_1(catId){
			$('input#hid').val(catId);
			findAssetCardBookByAcprimarystatus.getByAcprimarystatus(function(AssetCardBook){
				var amc = "<chart>";
				var a = "<series>";
				var b = "<graphs><graph gid='0'>";
				var num = 0;
				catId = $('input#hid').val();
				for(var i = 0;i<AssetCardBook.length;i++){
					if(AssetCardBook[i].card!=null&&AssetCardBook[i].card.category!=null&&catId==AssetCardBook[i].card.category.catid){
						a += "<value xid='"+ num +"'>"+AssetCardBook[i].operatedate+"</value>";
						b += "<value xid='"+ num +"'>"+parseInt(AssetCardBook[i].card.count)*parseInt(AssetCardBook[i].card.reportprice)+"</value>";
						nameToOut[num] = AssetCardBook[i].operatedate;
						priceToOut[num] = parseInt(AssetCardBook[i].card.count)*parseInt(AssetCardBook[i].card.reportprice);
						num++;
					}
				}
				amc += a + "</series>" + b + "</graph></graphs></chart>";
				openAmcolumn(amc);
				openAmline(amc);
			});
		}
		function findTimeAssetCardStatus(catId){
			$('input#hid').val(catId);
			findAssetCardBookByStatus.getByAcprimarystatusToStatus(function(AssetCardBook){
				var amc = "<chart>";
				var a = "<series>";
				var b = "<graphs><graph gid='0'>";
				var num = 0;
				catId = $('input#hid').val();
				for(var i = 0;i<AssetCardBook.length;i++){
					if(AssetCardBook[i].card!=null){
						if(AssetCardBook[i].card!=null&&AssetCardBook[i].card.category!=null&&catId==AssetCardBook[i].card.category.catid){
						a += "<value xid='"+ num +"'>"+AssetCardBook[i].operatedate+"</value>";
						b += "<value xid='"+ num +"'>"+AssetCardBook[i].card.count+"</value>";
						nameToOut[num] = AssetCardBook[i].operatedate;
						priceToOut[num] = AssetCardBook[i].card.count;
						num++;
						}
					}
				}
				amc += a + "</series>" + b + "</graph></graphs></chart>";
				openAmcolumn(amc);
				openAmline(amc);
			});
		}
		function findTimeAssetCardStatus_1(catId){
			$('input#hid').val(catId);
			findAssetCardBookByStatus.getByAcprimarystatusToStatus(function(AssetCardBook){
				var amc = "<chart>";
				var a = "<series>";
				var b = "<graphs><graph gid='0'>";
				var num = 0;
				catId = $('input#hid').val();
				for(var i = 0;i<AssetCardBook.length;i++){
					if(AssetCardBook[i].card!=null&&AssetCardBook[i].card.category!=null&&catId==AssetCardBook[i].card.category.catid){
						a += "<value xid='"+ num +"'>"+AssetCardBook[i].operatedate+"</value>";
						b += "<value xid='"+ num +"'>"+parseInt(AssetCardBook[i].card.count)*parseInt(AssetCardBook[i].card.reportprice)+"</value>";
						nameToOut[num] = AssetCardBook[i].operatedate;
						priceToOut[num] = parseInt(AssetCardBook[i].card.count)*parseInt(AssetCardBook[i].card.reportprice);
						num++;
					}
				}
				amc += a + "</series>" + b + "</graph></graphs></chart>";
				openAmcolumn(amc);
				openAmline(amc);
			});
		}
		function findTimeAssetCard(catId){
			$('input#hid').val(catId);
			findAssetCardBookByAcprimarystatus.getByAcprimarystatus(function(AssetCardBook){
				var amc = "<chart>";
				var a = "<series>";
				var b = "<graphs><graph gid='0'>";
				var num = 0;
				catId = $('input#hid').val();
				for(var i = 0;i<AssetCardBook.length;i++){
					if(AssetCardBook[i].card!=null&&AssetCardBook[i].card.category!=null&&catId==AssetCardBook[i].card.category.catid){
						a += "<value xid='"+ num +"'>"+AssetCardBook[i].operatedate+"</value>";
						b += "<value xid='"+ num +"'>"+AssetCardBook[i].card.count+"</value>";
						nameToOut[num] = AssetCardBook[i].operatedate;
						priceToOut[num] = AssetCardBook[i].card.count;
						num++;
					}
				}
				amc += a + "</series>" + b + "</graph></graphs></chart>";
				openAmcolumn(amc);
				openAmline(amc);
			});
		}
		function findAssetCardByAccountSubject(accountSubjectName){
			assetCardByAccount.getByAccountSubject(accountSubjectName,function(AssetCard){
				if(accountSubjectName!="会计科目"){
					var amp = "<pie>";
					var amc = "<chart>";
					var a = "<series>";
					var b = "<graphs><graph gid='0'>";
					var flag = 3;
					var num = 0;
					var catList = new Array();
					for(var i = 0;i < AssetCard.length;i++){
						if(AssetCard[i].accountsubject!=null){
							catList[num] = AssetCard[i].accountsubject;
						}else{
							catList[num] = "其他";
						}
						num++;
					}
					var priceList = new Array();
					var nameList = new Array();
					num = 0;
					var reCat = null;
					var repeatO = new Array();
					outer:
					for(var i = 0;i < catList.length;i++){
						for(var m = 0;m < repeatO.length;m++){
							if(repeatO[m]==catList[i]){
								continue outer;
							}
						}
						//reCat = new RegExp('^'+catList[i]+'.*?$');
						priceList[num] = 0;
						for(var n = 0;n < AssetCard.length;n++){
							if(catList[i]==AssetCard[n].accountsubject){
								nameList[num] = AssetCard[n].accountsubject;
								priceList[num] += parseInt(AssetCard[n].count);
							}
						}
						repeatO[num] = catList[i];
						num++;
					}
					nameToOut = nameList;
					priceToOut = priceList;
					for(var i = 0;i<priceList.length;i++){
							a += "<value xid='"+ i +"'>"+nameList[i]+"</value>";
							b += "<value xid='"+ i +"'>"+priceList[i]+"</value>";
							amp += "<slice title='"+nameList[i]+"'>"+priceList[i]+"</slice>";
					}
					amc += a + "</series>" + b + "</graph></graphs></chart>";
					amp += "</pie>";
					openAmcolumn(amc);
					openAmpie(amp);
					}else{
						var amp = "<pie>";
						var amc = "<chart>";
						var a = "<series>";
						var b = "<graphs><graph gid='0'>";
						var num = 0;
						var catList = new Array();
						for(var i = 0;i < AssetCard.length;i++){
							if(AssetCard[i].accountsubject!=null){
								catList[num] = AssetCard[i].accountsubject;
							}else{
								catList[num] = "其他";
							}
							num++;
						}
						var priceList = new Array();
						var nameList = new Array();
						num = 0;
						var repeatO = new Array();
						outer:
						for(var i = 0;i < catList.length;i++){
							for(var m = 0;m < repeatO.length;m++){
								if(repeatO[m]==catList[i]){
									continue outer;
								}
							}
							priceList[num] = 0;
							for(var n = 0;n < AssetCard.length;n++){
								if(catList[i]==AssetCard[n].accountsubject){
									nameList[num] = AssetCard[n].accountsubject;
									priceList[num] += parseInt(AssetCard[n].count);
								}
							}
							repeatO[num] = catList[i];
							num++;
						}
						nameToOut = nameList;
						priceToOut = priceList;
						for(var i = 0;i<priceList.length;i++){
								a += "<value xid='"+ i +"'>"+nameList[i]+"</value>";
								b += "<value xid='"+ i +"'>"+priceList[i]+"</value>";
								amp += "<slice title='"+nameList[i]+"'>"+priceList[i]+"</slice>";
						}
						amc += a + "</series>" + b + "</graph></graphs></chart>";
						amp += "</pie>";
						openAmcolumn(amc);
						openAmpie(amp);
					};
			});
		}
		function findAssetCardByAccountSubject_1(accountSubjectName){
			assetCardByAccount.getByAccountSubject(accountSubjectName,function(AssetCard){
				if(accountSubjectName!="会计科目"){
					var amp = "<pie>";
					var amc = "<chart>";
					var a = "<series>";
					var b = "<graphs><graph gid='0'>";
					var flag = 3;
					var num = 0;
					var catList = new Array();
					for(var i = 0;i < AssetCard.length;i++){
						if(AssetCard[i].accountsubject!=null){
							catList[num] = AssetCard[i].accountsubject;
						}else{
							catList[num] = "其他";
						}
						num++;
					}
					var priceList = new Array();
					var nameList = new Array();
					num = 0;
					var reCat = null;
					var repeatO = new Array();
					outer:
					for(var i = 0;i < catList.length;i++){
						for(var m = 0;m < repeatO.length;m++){
							if(repeatO[m]==catList[i]){
								continue outer;
							}
						}
						//reCat = new RegExp('^'+catList[i]+'.*?$');
						priceList[num] = 0;
						for(var n = 0;n < AssetCard.length;n++){
							if(catList[i]==AssetCard[n].accountsubject){
								nameList[num] = AssetCard[n].accountsubject;
								priceList[num] += (parseInt(AssetCard[n].count)*parseInt(AssetCard[n].reportprice));
							}
						}
						repeatO[num] = catList[i];
						num++;
					}
					nameToOut = nameList;
					priceToOut = priceList;
					for(var i = 0;i<priceList.length;i++){
							a += "<value xid='"+ i +"'>"+nameList[i]+"</value>";
							b += "<value xid='"+ i +"'>"+priceList[i]+"</value>";
							amp += "<slice title='"+nameList[i]+"'>"+priceList[i]+"</slice>";
					}
					amc += a + "</series>" + b + "</graph></graphs></chart>";
					amp += "</pie>";
					openAmcolumn(amc);
					openAmpie(amp);
					}else{
						var amp = "<pie>";
						var amc = "<chart>";
						var a = "<series>";
						var b = "<graphs><graph gid='0'>";
						var num = 0;
						var catList = new Array();
						for(var i = 0;i < AssetCard.length;i++){
								catList[num++] = AssetCard[i].depname;
						}
						var priceList = new Array();
						var nameList = new Array();
						num = 0;
						var repeatO = new Array();
						outer:
						for(var i = 0;i < catList.length;i++){
							for(var m = 0;m < repeatO.length;m++){
								if(repeatO[m]==catList[i]){
									continue outer;
								}
							}
							priceList[num] = 0;
							for(var n = 0;n < AssetCard.length;n++){
								if(catList[i]==AssetCard[n].depname){
									nameList[num] = AssetCard[n].depname;
									priceList[num] += (parseInt(AssetCard[n].count)*parseInt(AssetCard[n].reportprice));
								}
							}
							repeatO[num] = catList[i];
							num++;
						}
						nameToOut = nameList;
						priceToOut = priceList;
						for(var i = 0;i<priceList.length;i++){
								a += "<value xid='"+ i +"'>"+nameList[i]+"</value>";
								b += "<value xid='"+ i +"'>"+priceList[i]+"</value>";
								amp += "<slice title='"+nameList[i]+"'>"+priceList[i]+"</slice>";
						}
						amc += a + "</series>" + b + "</graph></graphs></chart>";
						amp += "</pie>";
						openAmcolumn(amc);
						openAmpie(amp);
					};
			});
		}
		function doFindByDep_1(depId){
			findAssetCardByDepName.getAssetCardByDepName(depId,function(AssetCard){
				if(depId!="000"){
				var amp = "<pie>";
				var amc = "<chart>";
				var a = "<series>";
				var b = "<graphs><graph gid='0'>";
				var flag = 3;
				var num = 0;
				var catList = new Array();
				for(var i = 0;i < AssetCard.length;i++){
			//		if(AssetCard[i].category.catid.length<=flag){
						catList[num++] = AssetCard[i].category.catid;
			//		}
				}
				var priceList = new Array();
				var nameList = new Array();
				num = 0;
				var reCat = null;
				var repeatO = new Array();
				outer:
				for(var i = 0;i < catList.length;i++){
					for(var m = 0;m < repeatO.length;m++){
						if(repeatO[m]==catList[i]){
							continue outer;
						}
					}
					//reCat = new RegExp('^'+catList[i]+'.*?$');
					priceList[num] = 0;
					for(var n = 0;n < AssetCard.length;n++){
						if(catList[i]==AssetCard[n].category.catid){
							nameList[num] = AssetCard[n].category.catname;
						}
						if(catList[i]==AssetCard[n].category.catid){
							priceList[num] = parseInt(AssetCard[n].count);
						}
					}
					repeatO[num] = catList[i];
					num++;
				}
				nameToOut = nameList;
				priceToOut = priceList;
				for(var i = 0;i<priceList.length;i++){
						a += "<value xid='"+ i +"'>"+nameList[i]+"</value>";
						b += "<value xid='"+ i +"'>"+priceList[i]+"</value>";
						amp += "<slice title='"+nameList[i]+"'>"+priceList[i]+"</slice>";
				}
				amc += a + "</series>" + b + "</graph></graphs></chart>";
				amp += "</pie>";
				openAmcolumn(amc);
				openAmpie(amp);
				}else{
					var amp = "<pie>";
					var amc = "<chart>";
					var a = "<series>";
					var b = "<graphs><graph gid='0'>";
					var num = 0;
					var catList = new Array();
					for(var i = 0;i < AssetCard.length;i++){
							catList[num++] = AssetCard[i].depname;
					}
					var priceList = new Array();
					var nameList = new Array();
					num = 0;
					var repeatO = new Array();
					outer:
					for(var i = 0;i < catList.length;i++){
						for(var m = 0;m < repeatO.length;m++){
							if(repeatO[m]==catList[i]){
								continue outer;
							}
						}
						priceList[num] = 0;
						for(var n = 0;n < AssetCard.length;n++){
							if(catList[i]==AssetCard[n].depname){
								nameList[num] = AssetCard[n].depname;
								priceList[num] += parseInt(AssetCard[n].count);
							}
						}
						repeatO[num] = catList[i];
						num++;
					}
					nameToOut = nameList;
					priceToOut = priceList;
					for(var i = 0;i<priceList.length;i++){
							a += "<value xid='"+ i +"'>"+nameList[i]+"</value>";
							b += "<value xid='"+ i +"'>"+priceList[i]+"</value>";
							amp += "<slice title='"+nameList[i]+"'>"+priceList[i]+"</slice>";
					}
					amc += a + "</series>" + b + "</graph></graphs></chart>";
					amp += "</pie>";
					openAmcolumn(amc);
					openAmpie(amp);
				};
			});
		}
		function doFindByDep(depId){
			alert("depId");
			findAssetCardByDepName.getAssetCardByDepName(depId,function(AssetCard){
				if(depId!="000"){
				var amp = "<pie>";
				var amc = "<chart>";
				var a = "<series>";
				var b = "<graphs><graph gid='0'>";
				var flag = 3;
				var num = 0;
				var catList = new Array();
				for(var i = 0;i < AssetCard.length;i++){
			//		if(AssetCard[i].category.catid.length<=flag){
						catList[num++] = AssetCard[i].category.catid;
			//		}
				}
				var priceList = new Array();
				var nameList = new Array();
				num = 0;
				var reCat = null;
				var repeatO = new Array();
				outer:
				for(var i = 0;i < catList.length;i++){
					for(var m = 0;m < repeatO.length;m++){
						if(repeatO[m]==catList[i]){
							continue outer;
						}
					}
					//reCat = new RegExp('^'+catList[i]+'.*?$');
					priceList[num] = 0;
					for(var n = 0;n < AssetCard.length;n++){
						if(catList[i]==AssetCard[n].category.catid){
							nameList[num] = AssetCard[n].category.catname;
						}
						if(catList[i]==AssetCard[n].category.catid){
							priceList[num] = (parseInt(AssetCard[n].count)*parseInt(AssetCard[n].reportprice));
						}
					}
					repeatO[num] = catList[i];
					num++;
				}
				nameToOut = nameList;
				priceToOut = priceList;
				for(var i = 0;i<priceList.length;i++){
						a += "<value xid='"+ i +"'>"+nameList[i]+"</value>";
						b += "<value xid='"+ i +"'>"+priceList[i]+"</value>";
						amp += "<slice title='"+nameList[i]+"'>"+priceList[i]+"</slice>";
				}
				amc += a + "</series>" + b + "</graph></graphs></chart>";
				amp += "</pie>";
				openAmcolumn(amc);
				openAmpie(amp);
				}else{
					var amp = "<pie>";
					var amc = "<chart>";
					var a = "<series>";
					var b = "<graphs><graph gid='0'>";
					var num = 0;
					var catList = new Array();
					for(var i = 0;i < AssetCard.length;i++){
							catList[num++] = AssetCard[i].depname;
					}
					var priceList = new Array();
					var nameList = new Array();
					num = 0;
					var repeatO = new Array();
					outer:
					for(var i = 0;i < catList.length;i++){
						for(var m = 0;m < repeatO.length;m++){
							if(repeatO[m]==catList[i]){
								continue outer;
							}
						}
						priceList[num] = 0;
						for(var n = 0;n < AssetCard.length;n++){
							if(catList[i]==AssetCard[n].depname){
								nameList[num] = AssetCard[n].depname;
								priceList[num] += parseInt(AssetCard[n].count)*parseInt(AssetCard[n].reportprice);
							}
						}
						repeatO[num] = catList[i];
						num++;
					}
					nameToOut = nameList;
					priceToOut = priceList;
					for(var i = 0;i<priceList.length;i++){
							a += "<value xid='"+ i +"'>"+nameList[i]+"</value>";
							b += "<value xid='"+ i +"'>"+priceList[i]+"</value>";
							amp += "<slice title='"+nameList[i]+"'>"+priceList[i]+"</slice>";
					}
					amc += a + "</series>" + b + "</graph></graphs></chart>";
					amp += "</pie>";
					openAmcolumn(amc);
					openAmpie(amp);
				}
			});
		}
		function queryAssetCard(categoryId){
			assetCardQuery.getInuseAssetCardByCatId(categoryId,function(AssetCard){
				var amp = "<pie>";
				var amc = "<chart>";
				var a = "<series>";
				var b = "<graphs><graph gid='0'>";
				if(categoryId.length==3){
					var flag = 6;
				}else if(categoryId.length==6){
					var flag = 10;
				}if(categoryId.length==0){
					var flag = 3;
				}
				var num = 0;
				var catList = new Array();
				for(var i = 0;i < AssetCard.length;i++){
					if(AssetCard[i].category.catid.length<=flag){
						catList[num++] = AssetCard[i].category.catid;
					}
				}
				var priceList = new Array();
				var nameList = new Array();
				num = 0;
				var reCat = null;
				var repeatO = new Array();
				outer:
				for(var i = 0;i < catList.length;i++){
					for(var m = 0;m < repeatO.length;m++){
						if(repeatO[m]==catList[i]){
							continue outer;
						}
					}
					reCat = new RegExp('^'+catList[i]+'.*?$');
					priceList[num] = 0;
					for(var n = 0;n < AssetCard.length;n++){
						if(catList[i]==AssetCard[n].category.catid){
							nameList[num] = AssetCard[n].category.catname;
						}
						if(reCat.test(AssetCard[n].category.catid)&&catList[i].length!=categoryId.length){
							priceList[num] += (parseInt(AssetCard[n].count)*parseInt(AssetCard[n].reportprice));
						}else if(catList[i].length==categoryId.length&&catList[i]==AssetCard[n].category.catid){
							priceList[num] += (parseInt(AssetCard[n].count)*parseInt(AssetCard[n].reportprice));
						}

					}
					repeatO[num] = catList[i];
					num++;
				}
				nameToOut = nameList;
				priceToOut = priceList;
				for(var i = 0;i<priceList.length;i++){
						a += "<value xid='"+ i +"'>"+nameList[i]+"</value>";
						b += "<value xid='"+ i +"'>"+priceList[i]+"</value>";
						amp += "<slice title='"+nameList[i]+"'>"+priceList[i]+"</slice>";
				}
				amc += a + "</series>" + b + "</graph></graphs></chart>";
				amp += "</pie>";
				openAmcolumn(amc);
				openAmpie(amp);
			});
		}
		function queryCategory(categoryId){
			categoryQuery.getCategoryByParentId(categoryId,function(categoryList){
				var amp = "<pie>";
				var amc = "<chart>";
				var a = "<series>";
				var b = "<graphs><graph gid='0'>";
				if(categoryId.length==3){
					var flag = 6;
				}else if(categoryId.length==6){
					var flag = 10;
				}if(categoryId.length==0){
					var flag = 3;
				}
				var num = 0;
				for(var i = 0;i<categoryList.length;i++){
					if(categoryList[i].catid.length==flag){
						a += "<value xid='"+ num +"'>"+categoryList[i].catname+"</value>";
						nameToOut[num] = categoryList[i].catname;
						priceToOut[num] = categoryList[i].catinusecount;
						if(categoryList[i].catinusecount ==null){
							b += "<value xid='"+ num +"'>0</value>";
							amp += "<slice title='"+categoryList[i].catname+"'>0</slice>";
						}else{
							b += "<value xid='"+ num +"'>"+categoryList[i].catinusecount+"</value>";
							amp += "<slice title='"+categoryList[i].catname+"'>"+categoryList[i].catinusecount+"</slice>";
						}
						num++;
					}
				}
				amc += a + "</series>" + b + "</graph></graphs></chart>";
				amp += "</pie>";

				openAmcolumn(amc);
				openAmpie(amp);
			});
		}
		//
	 	//资产类别树3
	 	//
		function buildTree5(titleName,check){
			d = new dTree('d');
			if(check=='1'){
				categoryManager.findAllCategory(function(category) {
					d.add(0, -1, '<b style="font-weight:bold;cursor:pointer;" onclick=findOverAsserCardBook("")>所有资产</b>');
					var name=null;
					for(var i=0; i<category.length; i++){
						var size = category[i].catid.length;
						if(size == 3){
							d.add(category[i].catid,0,
									"<b style='font-weight:bold;cursor:pointer;' onclick=findOverAsserCardBook('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 6){
							d.add(category[i].catid,category[i].catid.substr(0,3),
									"<b style='font-weight:bold;cursor:pointer;' onclick=findOverAsserCardBook('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 10){
							d.add(category[i].catid,category[i].catid.substr(0,6),
									"<b style='font-weight:bold;cursor:pointer;' onclick=findOverAsserCardBook('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}
					}
					inner = d.toString();
					showBuildTree();
					$('b').parent().attr('href','javascript:void(0)');
				});
			}else if(check=='2'){
				categoryManager.findAllCategory(function(category) {
					d.add(0, -1, '<b style="font-weight:bold;cursor:pointer;" onclick=findOverAsserCardBook_1("")>所有资产</b>');
					var name=null;
					for(var i=0; i<category.length; i++){
						var size = category[i].catid.length;
						if(size == 3){
							d.add(category[i].catid,0,
									"<b style='font-weight:bold;cursor:pointer;' onclick=findOverAsserCardBook_1('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 6){
							d.add(category[i].catid,category[i].catid.substr(0,3),
									"<b style='font-weight:bold;cursor:pointer;' onclick=findOverAsserCardBook_1('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 10){
							d.add(category[i].catid,category[i].catid.substr(0,6),
									"<b style='font-weight:bold;cursor:pointer;' onclick=findOverAsserCardBook_1('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}
					}
					inner = d.toString();
					showBuildTree();
					$('b').parent().attr('href','javascript:void(0)');
				});
			}
		}
		//
	 	//资产类别树2
	 	//
		function buildTree4(titleName,check){
			d = new dTree('d');
			if(check=='1'){
				categoryManager.findAllCategory(function(category) {
					d.add(0, -1, '<b style="font-weight:bold;cursor:pointer;" onclick=findTimeAssetCardStatus("")>所有资产</b>');
					var name=null;
					for(var i=0; i<category.length; i++){
						var size = category[i].catid.length;
						if(size == 3){
							d.add(category[i].catid,0,
									"<b style='font-weight:bold;cursor:pointer;' onclick=findTimeAssetCardStatus('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 6){
							d.add(category[i].catid,category[i].catid.substr(0,3),
									"<b style='font-weight:bold;cursor:pointer;' onclick=findTimeAssetCardStatus('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 10){
							d.add(category[i].catid,category[i].catid.substr(0,6),
									"<b style='font-weight:bold;cursor:pointer;' onclick=findTimeAssetCardStatus('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}
					}
					inner = d.toString();
					showBuildTree();
					$('b').parent().attr('href','javascript:void(0)');
				});
			}else if(check=='2'){
				categoryManager.findAllCategory(function(category) {
					d.add(0, -1, '<b style="font-weight:bold;cursor:pointer;" onclick=findTimeAssetCardStatus_1("")>所有资产</b>');
					var name=null;
					for(var i=0; i<category.length; i++){
						var size = category[i].catid.length;
						if(size == 3){
							d.add(category[i].catid,0,
									"<b style='font-weight:bold;cursor:pointer;' onclick=findTimeAssetCardStatus_1('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 6){
							d.add(category[i].catid,category[i].catid.substr(0,3),
									"<b style='font-weight:bold;cursor:pointer;' onclick=findTimeAssetCardStatus_1('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 10){
							d.add(category[i].catid,category[i].catid.substr(0,6),
									"<b style='font-weight:bold;cursor:pointer;' onclick=findTimeAssetCardStatus_1('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}
					}
					inner = d.toString();
					showBuildTree();
					$('b').parent().attr('href','javascript:void(0)');
				});
			}
		}
		//
	 	//资产类别树1
	 	//
		function buildTree3(titleName,check){
			d = new dTree('d');
			if(check=='1'){
				categoryManager.findAllCategory(function(category) {
					d.add(0, -1, '<b style="font-weight:bold;cursor:pointer;" onclick=findTimeAssetCard("")>所有资产</b>');
					var name=null;
					for(var i=0; i<category.length; i++){
						var size = category[i].catid.length;
						if(size == 3){
							d.add(category[i].catid,0,
									"<b style='font-weight:bold;cursor:pointer;' onclick=findTimeAssetCard('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 6){
							d.add(category[i].catid,category[i].catid.substr(0,3),
									"<b style='font-weight:bold;cursor:pointer;' onclick=findTimeAssetCard('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 10){
							d.add(category[i].catid,category[i].catid.substr(0,6),
									"<b style='font-weight:bold;cursor:pointer;' onclick=findTimeAssetCard('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}
					}
					inner = d.toString();
					showBuildTree();
					$('b').parent().attr('href','javascript:void(0)');
				});
			}else if(check=='2'){
				categoryManager.findAllCategory(function(category) {
					d.add(0, -1, '<b style="font-weight:bold;cursor:pointer;" onclick=findTimeAssetCard_1("")>所有资产</b>');
					var name=null;
					for(var i=0; i<category.length; i++){
						var size = category[i].catid.length;
						if(size == 3){
							d.add(category[i].catid,0,
									"<b style='font-weight:bold;cursor:pointer;' onclick=findTimeAssetCard_1('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 6){
							d.add(category[i].catid,category[i].catid.substr(0,3),
									"<b style='font-weight:bold;cursor:pointer;' onclick=findTimeAssetCard_1('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 10){
							d.add(category[i].catid,category[i].catid.substr(0,6),
									"<b style='font-weight:bold;cursor:pointer;' onclick=findTimeAssetCard_1('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}
					}
					inner = d.toString();
					showBuildTree();
					$('b').parent().attr('href','javascript:void(0)');
				});
			}
		}
	 	//
	 	//资产类别树
	 	//
		function buildTree(titleName,check){
			d = new dTree('d');
			if(check=='1'){
				categoryManager.findAllCategory(function(category) {
					d.add(0, -1, '<b style="font-weight:bold;cursor:pointer;" onclick=queryCategory("")>所有资产</b>');
					var name=null;
					for(var i=0; i<category.length; i++){
						var size = category[i].catid.length;
						if(size == 3){
							d.add(category[i].catid,0,
									"<b style='font-weight:bold;cursor:pointer;' onclick=queryCategory('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 6){
							d.add(category[i].catid,category[i].catid.substr(0,3),
									"<b style='font-weight:bold;cursor:pointer;' onclick=queryCategory('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 10){
							d.add(category[i].catid,category[i].catid.substr(0,6),
									"<b style='font-weight:bold;cursor:pointer;' onclick=queryCategory('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}
					}
					inner = d.toString();
					showBuildTree();
					$('b').parent().attr('href','javascript:void(0)');
				});
			}else if(check=='2'){
				categoryManager.findAllCategory(function(category) {
					d.add(0, -1, '<b style="font-weight:bold;cursor:pointer;" onclick=queryAssetCard("")>所有资产</b>');
					var name=null;
					for(var i=0; i<category.length; i++){
						var size = category[i].catid.length;
						if(size == 3){
							d.add(category[i].catid,0,
									"<b style='font-weight:bold;cursor:pointer;' onclick=queryAssetCard('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 6){
							d.add(category[i].catid,category[i].catid.substr(0,3),
									"<b style='font-weight:bold;cursor:pointer;' onclick=queryAssetCard('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}else if(size == 10){
							d.add(category[i].catid,category[i].catid.substr(0,6),
									"<b style='font-weight:bold;cursor:pointer;' onclick=queryAssetCard('"+category[i].catid+"')>"+category[i].catname+"</b>");
						}
					}
					inner = d.toString();
					showBuildTree();
					$('b').parent().attr('href','javascript:void(0)');
				});
			}
		}
		//
		//部门树
		//
		function buildTree1(titleName,check){
			d = new dTree('d');
			if(check=='1'){
				departmentDwrJs.getAllDepartment(function(departmentList) {
				d.add(-1, -2, '<b style="font-weight:bold;cursor:pointer;" onclick=doFindByDep("")>所有资产</b>');
				for ( var i = 0; i < departmentList.length; i++) {
							d.add(departmentList[i].depid,departmentList[i].depparentid,
									"<b style='font-weight:bold;cursor:pointer;' onclick=doFindByDep(\'"+departmentList[i].depid+"\')>"+departmentList[i].depname+"</b>");
				}
				inner = d.toString();
				showBuildTree();
				$('b').parent().attr('href','javascript:void(0)');
				});
			}else if(check=='2'){
				departmentDwrJs.getAllDepartment(function(departmentList) {
					d.add(-1, -2, '<b style="font-weight:bold;cursor:pointer;" onclick=doFindByDep_1("")>所有资产</b>');
					for ( var i = 0; i < departmentList.length; i++) {
								d.add(departmentList[i].depid,departmentList[i].depparentid,
										"<b style='font-weight:bold;cursor:pointer;' onclick=doFindByDep_1(\'"+departmentList[i].depid+"\')>"+departmentList[i].depname+"</b>");
					}
					inner = d.toString();
					showBuildTree();
					$('b').parent().attr('href','javascript:void(0)');
				});
			}
		}
		//
		//会计科目树
		//
		function buildTree2(titleName,check){
			d = new dTree('d');
			if(check=='1'){
				d.add(0, -1, '<b style="font-weight:bold;cursor:pointer;" onclick=findAssetCardByAccountSubject("")>会计科目</b>');
				d.add(1,0,"<b style='font-weight:bold;cursor:pointer;' onclick=findAssetCardByAccountSubject(\'低值易耗品摊销\')>低值易耗品摊销</b>");
				d.add(2,0,"<b style='font-weight:bold;cursor:pointer;' onclick=findAssetCardByAccountSubject(\'办公用品\')>办公用品</b>");
				d.add(3,0,"<b style='font-weight:bold;cursor:pointer;' onclick=findAssetCardByAccountSubject(\'固定资产\')>固定资产</b>");
				d.add(4,0,"<b style='font-weight:bold;cursor:pointer;' onclick=findAssetCardByAccountSubject(\'其他\')>其他</b>");
			}else if(check=='2'){
				d.add(0, -1, '<b style="font-weight:bold;cursor:pointer;" onclick=findAssetCardByAccountSubject_1("")>会计科目</b>');
				d.add(1,0,"<b style='font-weight:bold;cursor:pointer;' onclick=findAssetCardByAccountSubject_1(\'低值易耗品摊销\')>低值易耗品摊销</b>");
				d.add(2,0,"<b style='font-weight:bold;cursor:pointer;' onclick=findAssetCardByAccountSubject_1(\'办公用品\')>办公用品</b>");
				d.add(3,0,"<b style='font-weight:bold;cursor:pointer;' onclick=findAssetCardByAccountSubject_1(\'固定资产\')>固定资产</b>");
				d.add(4,0,"<b style='font-weight:bold;cursor:pointer;' onclick=findAssetCardByAccountSubject_1(\'其他\')>其他</b>");
			}
			inner = d.toString();
			showBuildTree();
			$('b').parent().attr('href','javascript:void(0)');
		}
		function showBuildTree() {
				myTree.innerHTML = inner;
		}
		$(document).ready(function(){
			var myTree = document.getElementById("myTree");
			d = new dTree('d');
			var inner;
		});
		function showamc(){
			$('div#amcharts_1').css('display','none');    
			$('div#amcharts_3').css('display','none');  
			$('div#amcharts_2').css('display','block');
		}
		function showamp(){
			$('div#amcharts_2').css('display','none');
			$('div#amcharts_3').css('display','none');  
			$('div#amcharts_1').css('display','block');
		}
		function showaml(){
			$('div#amcharts_2').css('display','none');
			$('div#amcharts_3').css('display','block');  
			$('div#amcharts_1').css('display','none');
		}
		function method2() //读取表格中每个单元到EXCEL中 
		{ 
		     var oXL = new ActiveXObject("Excel.Application"); 
		     //创建AX对象excel 
		     var oWB = oXL.Workbooks.Add(); 
		     //获取workbook对象 
		    var oSheet = oWB.ActiveSheet; 
		    //激活当前sheet 
		     //取得表格行数 
		    oSheet.Cells(1, 1).value = "asd"; 
		             //赋值 
		     oXL.Visible = true; 
		     //设置excel可见属性 
		}
		function exportImage() {   
            var flashMovie = document.getElementById('amcolumn');   
            if (flashMovie) {   
               flashMovie.exportImage('*.ExportImage');
            }   
         }
	</script>
	</head>
	<body>
	<div>
			<input type="button" id="check1" value="资产数量报表" onclick="buildTree('资产数量报表','1')" style="width:130px;margin-right:3px;"/>
			<input type="button" id="check2" value="资产价值报表" onclick="buildTree('资产价值报表','2')" style="width:130px;margin-right:3px;"/>
			<input type="button" id="check3" value="部门资产数量报表" onclick="buildTree1('部门资产数量报表','1')" style="width:130px;margin-right:3px;"/>
			<input type="button" id="check4" value="部门资产价值报表" onclick="buildTree1('部门资产价值报表','2')" style="width:130px;margin-right:3px;"/>
			<input type="button" id="check5" value="会计科目数量报表" onclick="buildTree2('会计科目数量报表','1')" style="width:130px;margin-right:3px;"/>
			<input type="button" id="check6" value="会计科目价值报表" onclick="buildTree2('会计科目价值报表','2')" style="width:130px;margin-right:3px;"/>
			<input type="button" id="check7" value="申报数量趋势表" onclick="buildTree3('申报数量趋势表','1')" style="width:130px;margin-right:3px;"/>
			<input type="button" id="check8" value="申报价值趋势表" onclick="buildTree3('申报价值趋势表','2')" style="width:130px;margin-right:3px;"/>
			<input type="button" id="check9" value="库存数量趋势表" onclick="buildTree4('库存数量趋势表','1')" style="width:130px;margin-right:3px;"/>
			<input type="button" id="check10" value="库存价值趋势表" onclick="buildTree4('库存价值趋势表','2')" style="width:130px;margin-right:3px;"/>
			<input type="button" id="check11" value="报废数量趋势表" onclick="buildTree5('报废数量趋势表','1')" style="width:130px;margin-right:3px;"/>
			<input type="button" id="check12" value="报废价值趋势表" onclick="buildTree5('报废价值趋势表','2')" style="width:130px;margin-right:3px;"/>
	</div>
	<div>
	<input type="hidden" id="hid"/>
		<div class="mainContainer"
			style="float: left; display: block; width: 300px;">
			<div class="headerTitle">
				请先选择资产类别
			</div>
			<div class="dtreeDiv" id="myTree"
				style="width: 200px; height: 400px;" onclick="">
			</div>
		</div>
			<input id="check_1" type="button" onclick="showamc()" value="柱状图" style="float: left;display: none;"/>
			<input id="check_2" type="button" onclick="showamp()" value="饼状图" style="float: left;display: none;"/>
			<input id="check_3" type="button" onclick="showaml()" value="折线图" style="float: left;display: none;"/>
			文件名:<input type="text" id="xlsName" />
		<!--<input type="button" onclick="toGetExcel()" value="选择路径"/>  -->	
			<input type="button" onclick="getToExcel()" value="导出excel"/>
			<input type="button" value="导出图片" onclick="exportImage();" /> 	
		<div id="ReportForms" style="float: left; display: block;">
			<div id="amcharts_1" style="float: left; display: none;background: #red;">
			</div>
			<div id="amcharts_2" style="float: left; display: block;background:black;">
			</div>
			<div id="amcharts_3" style="float: left; display: block;background:green;">
			</div>
		</div>
		</div>
	</body>
</html>